<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg">
  <head>
    <title>Time-related functions</title>
    <link rel="stylesheet" type="text/css" href="docbook-epub.css"/>
    <link rel="stylesheet" type="text/css" href="kawa.css"/>
    <script src="kawa-ebook.js" type="text/javascript"/>
    <meta name="generator" content="DocBook XSL-NS Stylesheets V1.79.1"/>
    <link rel="prev" href="Overall-Index.xhtml" title="Index"/>
    <link rel="next" href="Low-level-functions.xhtml" title="Deprecated low-level functions"/>
  </head>
  <body>
    <header/>
    <section class="sect1" title="Time-related functions" epub:type="subchapter" id="Time-related-functions">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both">Time-related functions</h2>
          </div>
        </div>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667869326464" class="indexterm"/> <code class="function">current-second</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Returns an inexact number represent the current time on the
<a class="ulink" href="http://en.wikipedia.org/wiki/International_Atomic_Time" target="_top">International Atomic Time (TAI)</a> scale.
The value 0.0 represents midnight on January 1, 1070 TAI (equivalent
to 10 seconds before midnight Universal Time), and
the value 1.0 represents on TAI second later.
Neither high acuracy nor high precision are required; in particular
returning Coordinated Universal Time plus a suitable
constant might be the best an implementation cat do.
The Kawa implementation just multiplies by 0.001 the result of calling
the method <code class="literal">currentTimeMillis</code> in class <code class="literal">java.lang.System</code>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667869320976" class="indexterm"/> <code class="function">current-jiffy</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Returns the number of <em class="firstterm">jiffies</em> as an exact integer that have
elapses since an arbitrary implementation-defined epoch (instant).
A jiffy is an implementation-defined fraction of a second which is
defined by the return value of the <code class="literal">jiffies-per-second</code> procedure.
The starting epoch (instant 0) is guaranteed to be constant during
a run of the program, but may vary between runs.
(At the time of writing, Kawa’s jiffy is one nano-second.)
</p>
          <p><span class="emphasis"><em>Rationale:</em></span> Jiffies are allowed to be implementation-dependent
so that <code class="literal">current-jiffy</code> can execute with minimal overhead.
It should be very likely that a compactly represented integer will
suffice as the return value.  Any particular jiffy size will be
inappropriate some some implementations: a microsecond is too long for
a very fast machine, while a much smaller unit would force many
implementations to return integers which have to allocated for most calls,
rendering <code class="literal">current-jiffy</code> less useful for accurate timing measurements.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667869314576" class="indexterm"/> <code class="function">jiffies-per-second</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Returns an exact integer representing the number of jiffies
per SI second. This value is an implementation-specified
constant.
(At the time of writing, the value in Kawa is 1,000,000,000.)
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667869311440" class="indexterm"/> <code class="function">sleep</code> <em class="replaceable"><code>time</code></em></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Suspends the current thread for the specified time.
The <em class="replaceable"><code>time</code></em> can be either a pure number (in secords),
or a quantity whose unit is a time unit (such as <code class="literal">10s</code>).
</p>
        </blockquote>
      </div>
    </section>
    <footer>
      <div class="navfooter">
        <p>
          Up: <a accesskey="u" href="Miscellaneous.xhtml">Miscellaneous topics</a></p>
        <p>
        Previous: <a accesskey="p" href="Processes.xhtml">Processes</a></p>
        <p>
        Next: <a accesskey="n" href="Low-level-functions.xhtml">Deprecated low-level functions</a></p>
      </div>
    </footer>
  </body>
</html>
